import request from '@/axios'
import type { UserType } from './types'

export const loginApi = (data: UserType): Promise<IResponse> => {
  return request.post({ url: '/auth/login', data })
}

export const logoutApi = (): Promise<IResponse> => {
  return request.get({ url: '/auth/logout' })
}

export const getCurrentUserInfoApi = (): Promise<IResponse> => {
  return request.get({ url: '/auth/current/user/info' })
}

export const getMenuListApi = (): Promise<IResponse<AppCustomRouteRecordRaw[]>> => {
  return request.get({ url: '/auth/getMenuList' })
}
